package com.iwhalecloud.citybrain.flow.platform.manager.infrastructure.mapper;

import com.iwhalecloud.citybrain.flow.platform.manager.infrastructure.entities.FlowEntrust;
import com.iwhalecloud.citybrain.flow.platform.manager.infrastructure.entities.FlowEntrustDetail;
import com.iwhalecloud.citybrain.flow.platform.manager.infrastructure.entities.FlowEntrustDetailQuery;
import com.iwhalecloud.citybrain.flow.platform.manager.infrastructure.entities.FlowEntrustQuery;

import java.util.Date;
import java.util.List;

/**
 * @author Huhangfei
 * @date 2021-11-16 17:34
 */
public interface FlowEntrustDAO {
    int insertEntrust(FlowEntrust flowEntrust);  //新建默认委托

    int updateEntrust(FlowEntrust flowEntrust);  //更新默认委托

    List<FlowEntrust> selectByClient(FlowEntrustQuery flowEntrustQuery); //根据用户查询

    int deleteEntrust(int id,Date date); //逻辑删除默认委托

    int deleteEntrustData(FlowEntrust flowEntrust);//删除数据库中的数据

    int insertEntrustDetailBatch(List<FlowEntrustDetail> flowEntrustDetails); //批量插入自定义委托表

    int insertEntrustDetail(FlowEntrustDetail flowEntrustDetail); //单个插入自定义委托表

    int deleteEntrustDetail(List<Integer> ids);

    List<Integer> queryEntrustDetail(int entrustId);

    List<FlowEntrustDetail> selectEntrustDetail(FlowEntrustDetailQuery flowEntrustDetailQuery);

    int updateEntrustDetail(FlowEntrustDetail flowEntrustDetails);

    List<FlowEntrust> selectEntrustAndDetail(FlowEntrustDetailQuery flowEntrustDetailQuery);

    int updateDefaultStatus(int id, int status, Date date); //更新默认委托的状态

    int updateStatusById(int id,int status,Date date); //更新自定义委托的状态

    int updateStatusByEntrustId(int id,int status,Date date); //更新自定义委托的状态通过默认委托的Id

    int queryEntrustStatusByDetailId(int id);  //根据自定义委托的id去查找默认委托的状态

    String selectEntrustClientById(int id); //根据默认委托id查询委托人

    List<FlowEntrust> selectEntrustById(int id); //根据默认委托id查询委托

    String selectEntrustClientDepartmentById(int id);//根据默认委托id查询委托人部门

    String selectEntrustDetailClientById(int id);//根据自定义委托id查询委托人

    List<FlowEntrust> selectEntrustByCondition(FlowEntrustQuery flowEntrustQuery); //条件查询默认委托；

    List<FlowEntrustDetail> selectEntrustDetailByCondition(FlowEntrustDetailQuery flowEntrustDetailQuery); //条件查询自定义委托；

}
